﻿<div title="修改密码">
    <form id="frmChangePassword" method="post" action="@Url.Action("ChangePassword")">
    @Html.ValidationSummary(true)
    </form>
</div>
<div class="form-bar">
    <input id="btnsubmit" type="button" class="button" name="submit" value="提交" />
</div>
@section footer{
    <script src="@Url.Content("~/Scripts/jquery/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery/jquery.metadata.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery/messages_cn.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var frmChangePassword = $("#frmChangePassword");
            frmChangePassword.ligerForm({
                fields: [
                    { display: '旧密码', name: 'OldPassword', type: 'password' },
                    { display: '新密码', name: 'NewPassword', type: 'password' },
                    { display: '确认密码', name: 'ConfirmPassword', type: 'password' }
                ]
            });
           
            $("#btnsubmit").click(function () {
                LG.submitForm(frmChangePassword, function (r) {
                    if (!r) {
                        LG.showError("操作错误!");
                    } else {
                        LG.showSuccess("保存成功", function () {
                            //if (parent.child) parent.child.close();
                            window.parent.location.replace('@Url.Action("LogOff")');

                        });
                    }
                });
            });
        })
    </script>
}
